#ifndef ELEMENTSELECTOR_H
#define ELEMENTSELECTOR_H

#include <QObject>
class QMouseEvent;

class ElementSelector : public QObject
{
    Q_OBJECT

public:
    enum SelectionType { Rectangle, Circle, Polygon };
    explicit ElementSelector(SelectionType selType, QObject *parent = 0);
    QPainterPath selectedArea() const;

    void mousePress(QMouseEvent* pEvent);
    void mouseMove(QMouseEvent* pEvent);
    void mouseRelease(QMouseEvent* pEvent);

    void draw() const;

    void setSelectionType(SelectionType type);
protected:

private:
    SelectionType m_selectionType;

    // Rectangle
    QRect m_rect;

    // Circle
    QPoint m_center;
    float m_fRadius;

    // Polygon
    QList<QPoint> m_poly;
signals:

public slots:
};

#endif // ELEMENTSELECTOR_H
